package com.beantools.util;

import static com.beantools.constants.MainASCCode.*;
import static com.beantools.util.ObjectUtil.isNull;

/**
 * 字符工具类
 *
 * @author baoya
 * @version 1.1.0
 * @since 1.0
 */

public class CharUtil {

    /**
     * 验证在某个区间内的字符
     *
     * @param c 字符
     * @return 验证成功，返回true，否则，返回false
     */
    public static boolean validateLetter(Character c) {
        if (isNull(c)) {
            return false;
        }
        return (c >= ASC_UPPER_A && c <= ASC_UPPER_Z)
                || (c >= ASC_LOWER_A && c <= ASC_LOWER_Z)
                || (c >= ASC_ZERO && c <= ASC_NINE);
    }
}
